<?php

Loader::using("ext::libs::inscripcionesGenericas::QuestionBasedUIControlFactory");

function smarty_function_render_control($params,
        Smarty_Internal_Template $template) {
    $question = $params["q"];
    $render = "";

    if ($question instanceof CamposFormularios) {
        $controlsFactory = QuestionBasedUIControlFactory::instance();
        $controlsFactory->setQuestion($question);
        
        $control = $controlsFactory->create();
        $render = $control->display(false);
    }

    return $render;
}


?>
